﻿<?xml version="1.0" encoding="utf-8" ?>
<Templates>
  <Template name="ItemXsdStart">
    <![CDATA[
<?xml version="1.0" encoding="utf-8" ?>
<!--
                            Produced by Channel Intelligence CIPl 
                                    generated on <date>
                                    from <schemaName>
                                        Copyright (c) <year> <companyName> - all rights reserved
-->
<xs:schema id="<schemaName>"
                  targetNamespace="<namespace>"
                  elementFormDefault="qualified"
                  xmlns="<namespace>"
                  xmlns:mstns="<namespace>"
                  xmlns:xs="http://www.w3.org/2001/XMLSchema">
]]>
  </Template>
  <Template name="TypeXsdStart">
    <![CDATA[
<!--
<typeString>
-->
    ]]>
  </Template>
  <Template name="XsdEnd">
    <![CDATA[
  <xs:complexType name="ExternalIDReferenceType">
    <xs:sequence>
      <xs:element name="value">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
]]>
  </Template>
  <Template name="XsdForCompound">
    <![CDATA[
	<outerElement>
	<xs:complexType name="<className>__Type">
    <xs:choice minOccurs="1">
      <classProperties>
    </xs:choice>
	</xs:complexType>
    ]]>
  </Template>
  <Template name="XsdForCompoundProperties">
    <![CDATA[
	<xs:complexType name="<className>__TypeProperties">
    <xs:sequence>
      <classProperties>
    </xs:sequence>
	</xs:complexType>
    ]]>
  </Template>
  <Template name="XsdForOuterElement">
    <![CDATA[
					<xs:element name="<propertyName>" type="<typeName>__TypeProperties" />
    ]]>
  </Template>
  <Template name="XsdTypeProperty">
    <![CDATA[
					<xs:element name="<propertyName>" type="<typeName>__TypeProperties" minOccurs="0"/>
    ]]>
  </Template>
  <Template name="XsdSimpleSVProperty">
    <![CDATA[
					<xs:element name="<propertyName>" type="<typeName>__Type" minOccurs="<minOccurs>"/>
    ]]>
  </Template>
  <Template name="xsdSimpleGuidProperty">
    <![CDATA[
      <xs:complexType name="<typeName>__Type">
        <xs:sequence>
          <xs:element name="<instanceName>">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:pattern value="[0-9a-fA-f]{8}-([0-9a-fA-f]{4}-){3}[0-9a-fA-f]{12}"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    ]]>
  </Template>
  <Template name="XsdSimpleMVProperty">
    <![CDATA[
      <xs:element name="<propertyName>" minOccurs="0">
        <xs:complexType>
          <xs:choice maxOccurs="<maxOccurs>" minOccurs="0">
            <xs:element name="<instanceName>" type="<typeName>MVType"/>
          </xs:choice>
          <xs:attribute name="Count" type="xs:long"/>
        </xs:complexType>
      </xs:element>
]]>
  </Template>
  <Template name="XsdSimpleMVEnumProperty">
    <![CDATA[
      <xs:element name="<propertyName>" minOccurs="0">
        <xs:complexType>
          <xs:choice maxOccurs="<maxOccurs>" minOccurs="0">
            <xs:element name="<instanceName>" type="<typeName>EnumType"/>
          </xs:choice>
          <xs:attribute name="Count" type="xs:long"/>
        </xs:complexType>
      </xs:element>
]]>
  </Template>
  <Template name="XsdCompoundMVProperty">
    <![CDATA[
					<xs:element name="<propertyName>" minOccurs="0">
						<xs:complexType>
							<xs:choice maxOccurs="<maxOccurs>" minOccurs="0">
								<classproperties>
							</xs:choice>
              <xs:attribute name="Count" type="xs:long"/>
						</xs:complexType>
					</xs:element>
    ]]>
  </Template>
  <Template name="XsdCompoundSVProperty">
    <![CDATA[
					<xs:element name="<propertyName>" type="<typeName>__Type" minOccurs="<minOccurs>"/>
    ]]>
  </Template>
  <Template name="XsdReferenceMVProperty">
    <![CDATA[
        <xs:element name="<propertyName>" minOccurs="0">
          <xs:complexType>
            <xs:choice maxOccurs="<maxOccurs>" minOccurs="0">
              <xs:element name="<instanceName>">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string"> <facets>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
            </xs:choice>
            <xs:attribute name="Count" type="xs:long"/>
          </xs:complexType>
        </xs:element>
    ]]>
  </Template>
  <Template name="XsdReferenceSVProperty">
    <![CDATA[
      <xs:element name="<propertyName>" minOccurs="<minOccurs>">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="<instanceName>">
              <xs:complexType>
                <xs:simpleContent>
                  <xs:extension base="xs:string"> <facets>
                  </xs:extension>
                </xs:simpleContent>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    ]]>
  </Template>

  <Template name="XsdSimpleType">
    <![CDATA[
  <xs:complexType name="<typeName>__Type">
    <xs:sequence>
      <xs:element name="<instanceName>">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="<underlyingTypeName>"> <facets>
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="<typeName>MVType">
    <xs:simpleContent>
      <xs:extension base="<underlyingTypeName>"> <facets>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
    ]]>
  </Template>

  <Template name="XsdFacet">
    <![CDATA[<xs:attribute name="<facetName>" type="<underlyingType>"/>]]>
  </Template>


  <Template name="XsdDocumentation">
    <![CDATA[
        <xs:annotation>
          <xs:documentation>
            <documentation>
          </xs:documentation>
        </xs:annotation>
    ]]>
  </Template>

  <Template name="XsdEnumType">
    <![CDATA[
  <xs:complexType name="<enumName>__Type">
    <xs:sequence>
      <xs:element name="<instanceName>">
        <xs:simpleType>
          <xs:restriction base="<enumName>EnumType"/>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="<enumName>EnumType">
    <xs:restriction base="<baseType>">
      <enums>
    </xs:restriction>
  </xs:simpleType>
    ]]>
  </Template>
  <Template name="XsdEnumValueId">
    <![CDATA[
      <xs:enumeration value="<value>" id="<id>">
        <documentation>
      </xs:enumeration>
    ]]>
  </Template>
  <Template name="XsdEnumValue">
    <![CDATA[
      <xs:enumeration value="<value>">
        <documentation>
      </xs:enumeration>
    ]]>
  </Template>
</Templates>
